import {BaseApiUrl} from "@/api/config";
import {throttle2sec, updateThrottle} from "@/helpers";

function capi(uri: string){
  return mande(BaseApiUrl + uri)
}

const user = capi('user')

export const getUsers = throttle2sec(() => user.get<Record<string, string>>(''))
export const newUser = updateThrottle((userId: string, newUserData: Record<string, string>) => user.post(userId, newUserData))
